package com.hospital.config;

import io.swagger.annotations.Api;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author xhl
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {

    @Bean
    public Docket docket() {
        ApiInfo apiInfo = new ApiInfoBuilder().title("北京三医院(实验内容样本管理)API文档")
                .description("Swagger2的RESTful风格API").version("V1.0").build();
        Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
                .select() .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)).build();;
        return docket;
    }

}
